package zl.annotation;

import java.lang.annotation.Annotation;

@SuppressWarnings("unchecked")
public class Test {
	
	public static void main(String[] args) throws ClassNotFoundException {
		//反射操作、得到User类的Class对象
		Class<User> c = (Class<User>)Class.forName("zl.annotation.User");
		//得到User类的所有注释
		Annotation[] as = c.getAnnotations();
		for(Annotation a : as)
		{
			if(a instanceof Entity) 
				System.out.println(((Entity)a).name());  //得到指定注释的指定值
		}
	}
}
